New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding a "packaging flow" overview document #1100
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much @cameron-simpson!
…s, suggestion from @sinoroc
@pfmoore @abravalheri if we're broadly happy with this PR as it is now, whom should I petition to get it merged? |
Sorry, I don't know who the maintainers of packaging.python.org are. |
I can merge this after reviewing it (probably this weekend), or @webknjaz can do it if he approves. |
Just a quiet ping, in case this fell off your radar. Thanks, Cameron |
Yep, thanks for the ping. It's on my radar every day, but life has been exceedingly busy, and will continue to be through at least this weekend. |
On 19Jul2022 06:39, Brian Rutledge ***@***.***> wrote:
Yep, thanks for the ping. It's on my radar every day, but life has
been exceedingly busy, and will continue to be through at least this
weekend.
No worries. Sorry to trouble you. Cheers, Cameron
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just pushed a bunch of edits that I think streamline the description of the flow, while maintaining its overall structure. A number of changes are basic copy-editing for consistency of language. I also removed content that felt overly-specific and/or redundant. The biggest change is probably condensing the build-system
description. Finally, I left a number of TODOs that can be addressed in this PR, or in follow-ups.
If y'all are content with the changes, I'm happy to merge this.
@cameron-simpson My turn for a quiet ping. 😉 |
…EP elsewhere in context though
I've covered off everything except the final TODO about mentioning virtual environments and tools like poetry etc. I'm still a bit reluctant to introduce this in a conceptual explaination like this one, which already feels like it is getting wordy. And I haven't figured out what I would write here anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cameron-simpson Thanks for the updates. I want to make some more to polish it up; I'm aiming to do that in the next few days.
On 27Jul2022 05:27, Brian Rutledge ***@***.***> wrote:
***@***.*** Thanks for the updates. I want to make some more
to polish it up; I'm aiming to do that in the next few days.
Thank you, Cameron
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cameron-simpson I just pushed my edits. The biggest changes are in the "configuration file" and "built distributions" sections. What do you think?
On 28Jul2022 05:18, Brian Rutledge ***@***.***> wrote:
@bhrutledge approved this pull request.
***@***.*** I just pushed my edits. The biggest changes are in
the "configuration file" and "built distributions" sections. What do
you think?
Thank you. I've reviewed the diff and they look like improvements across
the board.
+These last 2 steps are typically performed by a tool like :ref:`pip`.
***@***.*** This is nit-picky, but I removed this line in my
first round of edits because the steps didn't mention any other tools,
so it seemed out of place. Do you feel strongly about including it?
I do, though I'm open to rephrasing to make it clear that this isn't
something which only `pip` can do.
What I specificly wanted to achieve was to hook an action the reader is
almost certainly very familiar with (`pip install`) to its place in the
flow.
How about:
For example, when an end user runs ``pip install`` to install
packages, :ref;`pip` is performing these last 2 steps.
Is there a second example tool commonly used to install local packages
we could also mention?
i wanted it up the front here where the last 2 steps are in front of the
reader's eyeballs.
Cheers,
Cameron Simpson ***@***.***>
|
On 28Jul2022 15:33, Brian Rutledge ***@***.***> wrote:
***@***.*** Thanks for explaining your reasoning; I
understand
what you're going for. Here's a small tweak.
Thank you, that looks great.
Cheers,
Cameron Simpson ***@***.***>
|
On 28Jul2022 15:37, Brian Rutledge ***@***.***> wrote:
Merged [1]#1100 into main.
Thank you! - Cameron Simpson ***@***.***>
|
Thank you for the PR! |
On 21Jul2022 08:15, Brian Rutledge ***@***.***> wrote:
@bhrutledge approved this pull request.
I just pushed a bunch of edits that I think streamline the description
of the flow, while maintaining its overall structure. A number of
changes are basic copy-editing for consistency of language.
I see that we like full sentences in bullet lists, and the Oxford comma
:-) And folding at a line length instead of a sentence/phrase break.
I also
removed content that felt overly-specific and/or redundant.
Reading the diff now.
Short summary: I like almost everything you've done.
My only objections are:
Under "To use the package, end users must:" you've dropped "These last 2
steps are typically performed by a tool like `pip`_.". I think that's
important and concise context, since many (most?) users will already be
familiar with using pip to fetch packages. I wanted it apparent that
when they did that familiar action, they're doing these last 2 steps.
The better to hook this to their mental model and experience.
TODOs:
- I deliberately avoided "build backend"; there's already confusion
between a build front end (which I take to be something you directly
invoke, such as a command line) and a build back end (which I take to
be an API compliant with the PEP so that things like "pip" can run it
directly).
To the new user, this is conceptual noise. They'll be using a build
tool (setuptools, flit, whatever) and this is about the process around
embedding their chosen tool in their distribution flow.
So I prefer "build tool" at this point.
- Link to tools: are you suggesting that where there's a tool specific
entry in key_projects.rst we should point to it instead of (eg) a PyPI
or github link? If so, I am all for it - the links I've found were
merely the most apt I could see.
- I don't have an opinion on hatchling vs flit, just that there should
be at least 2 examples to show that you can use any compliant build
tool in [build-system]. I could argue that it is good to use hatchling
if the tutorial uses it, or good to use flit to show that the tutorial
isn't the Only Way.
- "build system" vs "build frontend"; see, I thought pip would fetch a
module containing a build _backend_. Confusion already. I'd go for
saying "build tool" once more. Or, given the TOML table name, "build
system" throughout instead of "build tool".
However, I think "build tool" is a more approachable term; to my mind
it feels like something one can just fetch and use versus "build
system" which feels to me more like a bulky framework one must work
within.
I agree with dropping mention of the stub `setup.py` if that is truly
redundant these days; a stub seemed to be recommended when I wrote this
stuff. It is definitely confusing extra noise for this document.
I have mixed feelings about mentioning virtual environments. That's very
much an end user thing instead of a publisher thing. And there are so
many choices! For example, I'm still using "python3 -m venv" because I
have yet to see what value something like pipenv brings :-)
Maybe a rider paragraph right at the end mentioning that there are
several flavours of "Python environment" end users may be using, with
some of the links you mention. I would want to make it clear that the
package _author_ should not need to care how the end user manages their
Python environment. Without that clarification, authors/publishers have
an additional (and needless) mental burden when preparing their
packages. I know extraneous things like this mentally burden me when
coming to a new area.
|
Per @pfmoore 's suggestion here:
https://discuss.python.org/t/adding-a-packaging-flow-overview-to-the-pypa-docs/15060/3?u=cameron
this pull request offers a document providing a conceptual overview of the PyPA package publishing flow, proposal here:
https://discuss.python.org/t/adding-a-packaging-flow-overview-to-the-pypa-docs/15060
I came to write this after writing this post: https://discuss.python.org/t/modernising-my-packages-am-i-thinking-about-this-all-wrong/14558?u=cameron where I described the problems I had trying to figure out how to move to a more modern
pyproject.toml
based system for my packages, largely because I became swamped in a sea of detailed documents which I could not string together; the PEPs in particular are written for people already very familiar with the packaging ecosystem.This document is (a) not a tutorial and (b) not a "how to". Its purpose is to outline the required high level semantic steps involved in publishing a package, showing the flow from the author to (typically) PyPI and then on to the end user.
It has had some mostly positive feedback in the linked discussions which I've tried to take onboard.